Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use the Pkg.Registry API #39

Closed

Conversation

danielmatz
Copy link

As of Julia 1.7, Pkg.Registry provides some of the capability that had
been implemented in this package. This commit makes this package's
reachable_registries a simple wrapper around
Pkg.Registry.reachable_registries and removes the RegistryInstance
and PkgEntry types in favor of the types of the same name in
Pkg.Registry.

The largest change is that this package's version of
RegistryInstance stored a dictionary mapping package names to
PkgEntrys, but Pkg.Registry's version has a dictionary mapping
UUIDs to PkgEntrys.

A benefit of using the Pkg.Registry API is that it already supports
both uncompressed registries as well as registries stored in
compressed tarballs. Thus, this fixes #37.

@danielmatz
Copy link
Author

danielmatz commented Jun 22, 2022

We now use @static to keep the original implementation in place, but then use the new Pkg.Registry capabilities for Julia v1.7 and later. This seems to work, though we'll have to be very careful going forward. The PkgEntry and RegistryInstance types may have the same name, but their fields are just different enough to cause trouble.

I tested this locally on Julia 1.6 and 1.7, but I'd appreciate an extra set of eyes to make sure I didn't mess anything up.

@mattBrzezinski
Copy link
Member

This package had its workflows disabled, things look good to me though. Not sure how to re-kick the CI to run, maybe just this comment will be enough? If not could you amend a commit message, force push back and that should start the job?

As of Julia 1.7, Pkg.Registry provides some of the same capability
implemented in this package. When `VERSION` is at least v1.7, we use
`Pkg.Registry.reachable_registries`, `Pkg.Registry.RegistryInstance`,
and `Pkg.Registry.PkgEntry` instead of the custom versions implemented
in this package. For lower version numbers, we use the custom versions
implemented in this package.

The largest change when using the new capabilities in Pkg.Registry is
that this package's version of `RegistryInstance` stored a dictionary
mapping package names to `PkgEntry`s, but Pkg.Registry's version has a
dictionary mapping `UUID`s to `PkgEntry`s.

A benefit of using the `Pkg.Registry` API is that it already supports
both uncompressed registries as well as registries stored in
compressed tarballs. Thus, this fixes JuliaEcosystem#37.
@danielmatz danielmatz force-pushed the use-pkg-registry-api branch from f8752c0 to 59473f4 Compare June 23, 2022 15:14
@danielmatz
Copy link
Author

I force pushed, but now it seems to be waiting for your approval.

@giordano
Copy link
Member

Yet another option is to use https://github.com/GunnarFarneback/RegistryInstances.jl (and this package was actually already suggested as a possible beneficiary)

@danielmatz
Copy link
Author

I finally had some time to look at this again. I've created yet another pull request that takes the approach of using RegistryInstances. See #42. I'll close this in favor of that new PR.

@danielmatz danielmatz closed this Dec 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

reachable_registries doesn't find the General registry
3 participants